package com.woniu.order.client;

import com.woniu.order.client.param.SearchOrderEntryParam;
import com.woniu.order.client.result.OrderEntryQueryResultInfo;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "orderEntryQueryClient",name="order")
public interface OrderEntryQueryClient {

    /**
     * 根据订单Id、SkuId查询订单条目
     * @param searchOrderEntryParam
     * @return
     */
    @PostMapping("searchOrderEntry")
    public Result<OrderEntryQueryResultInfo> searchOrderEntry(@RequestBody SearchOrderEntryParam searchOrderEntryParam);

    /**
     * 根据orderId查找相关的商品信息
     * @param orderId
     * @return
     */
    @GetMapping("searchOrderAllEntry")
    public Result<List<OrderEntryQueryResultInfo>> searchOrderAllEntry(@RequestParam("orderId") Integer orderId);

}
